/**
 * Copyright (C), 2019-2020, 宇信融汇
 * FileName: GenericTest1
 * Author:   666
 * Date:     2020/7/27 22:55
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * 666           修改时间           版本号              描述
 */
package c_010.generic;

import org.junit.Test;

import java.util.List;

/**
 * @Classname GenericTest1
 * @Description TODO
 * @Date 2020/7/27 22:55
 * @Created by 666
 */
public class GenericTest1 {
    @Test
    public void test1() {
        Order<String> order = new Order<>("aaa",12,"22");//使用了类型推断，不需要写类型
        order.setOrderT("String");
        System.out.println(order);
    }
    @Test
    public void test2() {
        SubOrder subOrder = new SubOrder();
        subOrder.setOrderT(12);
        System.out.println(subOrder);
    }

    @Test
    public void test3() {
        SubOrder1<String> subOrder = new SubOrder1<>();
        subOrder.setOrderT("12");
        System.out.println(subOrder);

        SubOrder1<Integer> subOrder1= new SubOrder1<>();
        subOrder1.setOrderT(12);
        System.out.println(subOrder1);
    }

    @Test
    public void test4() {
        Order<String> order = new Order<>();
        Integer arr[] = new Integer[]{1, 2, 3, 4};
        List<Integer> integers = order.comyFromArrayList(arr);
        System.out.println(integers);

    }

    @Test
    public void test5() {
        Order<String> order = new Order();
        Integer[] arr = new Integer[]{1, 2, 3};
        List<Integer> list = order.copyFromArrayList(arr);
        System.out.println(list);
    }
    
}
